import { createApp } from 'vue';
import ElementPlus from 'element-plus';
import zhCn from 'element-plus/es/locale/lang/zh-cn';
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

import pinia from './store';
import router from './router';
import App from './App.vue';

// import '@/router/permission';

import 'element-plus/dist/index.css';

// 重置默认样式
import 'reset-css';
// iconfont
import '@/assets/iconfont/iconfont.css';
import '@/assets/iconfont/iconfont-weapp-icon.css';
// 主题
import '@/styles/index.scss';

const app = createApp(App);

app.use(pinia).use(router).use(ElementPlus,{
	locale: zhCn,
}).mount('#app');

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

app.config.errorHandler = (err, instance, info) => {
    // 向追踪服务报告错误
    console.log(err, instance, info);
}
